package com.itany.corejava.code08_常用类.练习;

/**
 * @author MissChen
 * @version 1.0
 * @date 2023 年11月15日 16:59
 */

/**
 * 定义Person类,
 * 有名字，有性别(MALE、FEMALE)
 *
 * 定义枚举类
 * 有性别的值男或者女
 *
 * 再定义一个测试类，调用Person类
 */
public class Person {
    private String name;
    private Gender gender;

    public Person(String name, Gender gender) {
        this.name = name;
        this.gender = gender;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Gender getGender() {
        return gender;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", gender=" + gender +
                '}';
    }
}
